package global.io;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.Scanner;

public class ReadFile {
	private String path;
	public void readfile(String path ){
		this.path=path;
	}
	public void read(){
		System.out.println("nhap vao duong dan file can doc");
		Scanner a=new Scanner(System.in);
		this.path=a.nextLine();
		
		File file1=new File(this.path);
	    
        try {
            FileReader fr = new FileReader(file1);
            BufferedReader br=new BufferedReader(fr);
            String line="";
            int i=0;
            while((line = br.readLine()) !=null){
                System.out.println(++i +":"+line);
                }
            br.close();
            fr.close();
        } catch (FileNotFoundException ex) {
            Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex);
        } catch(IOException e){ }
	}
//	public static void main (String[] args){
//		ReadFile a=new ReadFile();
//		a.read();
//	}
}
